package com.example.blog.domain;



import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;


@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class Users {
    @TableId(type = IdType.AUTO)
    private Long uid;  //用户ID
    private String account; // 用户名
    @NotBlank(message = "密码不能为空")
    @Size(min = 5,max = 25,message = "无效的密码格式")
    private String password; //密码
    @NotBlank(message = "账号不能为空")
    @Size(min = 5,max = 25,message = "无效的账号格式")
    private String username; // 账号
    private String email;//邮箱
    @TableField(exist = false)
    private String captcha;//验证码
    @TableField(exist = false)
    private String captcha_id;//验证码

    public Users(String username, String account, String password) {
        this.username=username;
        this.account=account;
        this.password = password;
    }
}
